#!/usr/bin/ruby
require 'rubygems'
require 'rqrcode'
require 'qr_image'

productname = ARGV[0]
length = productname.length
(length + 1).upto(20).each do |i|
	productname += ' '
end

price = '    '

location = ARGV[1]
length = location.length
(length + 1).upto(20).each do |i|
	location += ' '
end

size = 5
level = 'h'

qr = RQRCode::QRCode.new(productname + price + location, :size => size, :level => level)
img = QRImage.new(qr).sample(4)
img.write(ARGV[2]) { quality = 100 }
